package mysqlx

import (
	"rdbmsx/config"

	_ "github.com/go-sql-driver/mysql"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"gorm.io/gorm/logger"
)

func CreatDB() *gorm.DB {
	db, err := gorm.Open(mysql.Open(config.Mysql.DSN(nil)), &gorm.Config{
		Logger: logger.Default.LogMode(logger.Info),
	})
	if err != nil {
		panic(err)
	}

	return db
}
